<?php

namespace app\admin\command;

use app\common\library\Credit;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
use think\Db;
use think\Exception;
use think\Log;

class CalcCredit extends Command
{
    protected function configure()
    {
        $this->setName('calc_credit')
            ->setDescription('calc user credit');
    }

    protected function execute(Input $input, Output $output)
    {
        @ini_set("memory_limit", '-1');
        $stime = microtime(true);

        $credit = new Credit();
        $credit->calcCreditDaemon();

        $etime = microtime(true);//获取程序执行结束的时间
        $total = $etime - $stime;   //计算差值
        $output->writeln($total);
    }

}
